home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / DATABASE / PUSHBU.ZIP;1 / PUSHBUTN.CH < prev    next >
Encoding:
Text File  |  1993-06-13  |  6.2 KB  |  136 lines

  1. /*------------------------------------------------------------------------*
  2.  
  3.     Push Buttons Get Command
  4.     NOTE: Adapted from public domain program written by Dan Comeau, 1991
  5.  
  6. *-------------------------------------------------------------------------*/
  7.  
  8. #define  OK_BUTTON           1
  9. #define  YES_NO_BUTTONS      2
  10. #define  QUIT_RETRY_DEFAULT  3
  11.  
  12. #command @ <row>, <col>  GET <var>                                        ;
  13.                         [COLOR <color>]                                   ;
  14.                         [SEND <msg>]                                      ;
  15.                         [START AT <start>]                                ;
  16.                          WITH PUSHBUTTONS <buttons>                       ;
  17.          => SetPos( <row>, <col> )                                        ;
  18.           ; aAdd( GetList, _GET_( <var>, <(var)>, "9" ) )                 ;
  19.          [; aTail(GetList):colorDisp(<color>)]                            ;
  20.          [; aTail(GetList):<msg>]                                         ;
  21.           ; PushBtnNew(aTail(getlist),<row>,<col>,<var>,<start>,<buttons>);
  22.           ; aTail(getlist):reader := { |get| PushBtnReader( get ) }
  23.  
  24.  
  25. // OLD PUSHBUTTONS
  26. #xcommand @<row>, <col> GET <nSele>                                       ;
  27.                         AS PUSHBUTTON                                     ;
  28.                         START WITH <nStart>                               ;
  29.                         BUTTONS <aButtons>                                ;
  30.                         [ACTIONS <aActions> ]                             ;
  31.                         => <nSele> := Pus_BtnBar( <row>, <col>,           ;
  32.                                       <nStart>, <aButtons>, <aActions>    )
  33.  
  34.  
  35. /*------------------------------------------------------------------------*
  36.  
  37.     Radio Button Get Command
  38.     NOTE: Adapted from public domain program written by Dan Comeau, 1991
  39.     NOTE: This adaptation includes options which do not comply with the 
  40.     latest release of RADIOBTN.PRG. See RADIOB.ZIP in Library 1.
  41.  
  42. *-------------------------------------------------------------------------*/
  43.  
  44. #command @ <row>, <col> [SAY <sayxpr>]                                    ;
  45.                          GET <var>                                        ;
  46.                         [COLOR <color>]                                   ;
  47.                         [WHEN <when>]                                     ;
  48.                         [SEND <msg>]                                      ;
  49.                          WITH RADIOBUTTONS <buttons>                      ;
  50.                         [<horiz: HORIZONTAL>]                             ;
  51.                         [<nobox: NOBOX>]                                  ;
  52.                         [<double: DOUBLE>]                                ;
  53.                         [<tab2kill: TAB2KILL>]                            ;
  54.          => SetPos( <row>, <col> )                                        ;
  55.           ; aAdd( GetList, _GET_( <var>, <(var)>, "9",, <{when}> ) )      ;
  56.          [; aTail(GetList):colorDisp(<color>)]                            ;
  57.          [; aTail(GetList):<msg>]                                         ;
  58.           ; RadioBtnNew( aTail(getlist), <{when}>,                        ;
  59.                         <row>, <col>, <sayxpr>, <var>,                    ;
  60.                         <buttons>, <.nobox.>, <.double.>, <.horiz.> )     ;
  61.           ; aTail(getlist):reader := { |get| RadioBtnReader( get,         ;
  62.                         <.nobox.>, <.horiz.>, <.tab2kill.>, <sayxpr> ) }
  63.    
  64.  
  65. /*------------------------------------------------------------------------*
  66.     Windows Constants & Commands
  67. *-------------------------------------------------------------------------*/
  68.  
  69. // Win_Create() defaults
  70. #define  WIN_DFLT_TOP        0
  71. #define  WIN_DFLT_LFT        0
  72. #define  WIN_DFLT_BOT        MaxRow()
  73. #define  WIN_DFLT_RGT        MaxCol()
  74. #define  WIN_DFLT_COLOR      ColorSet(COL_WIND_STD)
  75. #define  WIN_DFLT_TYPE       "W"
  76. #define  WIN_DFLT_SHADOW     7
  77. #define  WIN_DFLT_ZOOMER     .T.
  78. #define  WIN_DFLT_SPEEDER    20
  79. #define  WIN_DFLT_TITLE_COL  "N/W+*"   // Requires SetBlink(.F.)
  80. #define  WIN_DFLT_TITLE_MON  "N/W"
  81. #define  WIN_DFLT_CON_MENU   "W"
  82. #define  WIN_DFLT_HOR_MENU   ""
  83. #define  WIN_DFLT_VER_MENU   ""
  84. #define  WIN_DFLT_EXIT_BLK   "{ || Win_Alert() }"
  85. #define  WIN_DUMB_WINDOW     "X"
  86.  
  87. // Simulate '@...SAY' in a window
  88. #xcommand @ <r>, <c> WSAY <t> => Win_Say( <r>, <c>, <t> )
  89.  
  90. // Simulate '@...GET' in a window
  91. #xcommand @ <r>, <c> WGET <v> [<list,...>]  => ;
  92.           @ Win_Row( <r> ), Win_Col( <c> ) get <v> [<list>]
  93.  
  94. // Simulate '@ t, l TO b, r' in a window
  95. #xcommand @ <t>, <l> WTO <b>, <r> => ;
  96.           @ Win_Row( <t> ), Win_Col( <l> ) TO Win_Row( <b> ), Win_Col( <r> )
  97.  
  98.  
  99. /*-------------------------------------------------------------------------*
  100.     Color System Constants.
  101. *--------------------------------------------------------------------------*/
  102.  
  103. // Abbreviate color constants, type WINDOW
  104. #define  COL_WIND_STD        4,1
  105. #define  COL_WIND_BOLD       4,2
  106. #define  COL_WIND_TEXT       4,3
  107. #define  COL_WIND_SEL        4,4
  108. #define  COL_WIND_UNSEL      4,5
  109.  
  110.  
  111. /*------------------------------------------------------------------------*
  112.     Sounds Constants
  113. *-------------------------------------------------------------------------*/
  114.  
  115. #define  SOUND_UPTONE        1         // "Dootle, Doot"
  116. #define  SOUND_DOWNTONE      2         // "Doodle, Dude"
  117. #define  SOUND_ALERT         3         // "Dootle, Dootle, Doot"
  118. #define  SOUND_BEEPER        4         // "Dee, Dee, Dee"
  119. #define  SOUND_PROCESSING    5         // "Duuu, Duuu, Duuu"
  120. #define  SOUND_RASPBERRY     6         // "BLAAHHH"
  121.  
  122.  
  123. /*------------------------------------------------------------------------*
  124.     Additional Inkey Values
  125. *-------------------------------------------------------------------------*/
  126.  
  127. #define K_SPACE              32
  128. #define K_SPACEBAR           32
  129.  
  130. /*------------------------------------------------------------------------*
  131.     Miscelaneous Definitions
  132. *-------------------------------------------------------------------------*/
  133.  
  134. // Window frame sting
  135. #define  B_WINDOW            "€fl€€€‹€€"
  136.